﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FS.Model.Model;
using NHibernate;

namespace Fruit.DAL
{
    /// <summary>
    /// 性别信息-数据访问
    /// </summary>
    public class SexService
    {
        private ISession _Session;

        public SexService()
        {
            _Session = new SessionService().GetSession();
        }

        public SexService(ISession session)
        {
            _Session = session;
        }

        public ISession Session
        {
            get { return _Session; }
            set { _Session = value; }
        }

        /// <summary>
        /// 获取所有性别
        /// </summary>
        /// <returns></returns>
        public IList<Sex> GetAllSex()
        {
            return _Session.CreateQuery("from Sex").List<Sex>();
        }
    }
}
